
    
const gulp = require("gulp");
const sass = require("gulp-sass");

let basePath = "D:\\phpSthdy\\PHPTutorial\\WWW";



function copyhtml(){
    gulp.src("html/**/*")
    .pipe(gulp.dest(basePath+"\\levis\\html"));
}

function copyImages(){
    gulp.src("images/**/*")
    .pipe(gulp.dest(basePath+"\\levis\\images"));
}

function copyjs(){
    gulp.src("js/**/*")
    .pipe(gulp.dest(basePath+"\\levis\\js"));
}

function doSass(){
    gulp.src("sass/*.scss")
        .pipe(sass())
        .pipe(gulp.dest(basePath+"\\levis\\css"));
}

function copyPhp(){
    gulp.src("php/**/*")
    .pipe(gulp.dest(basePath+"\\levis\\php"));
}

function copyCss(){
    gulp.src("css/**/*")
    .pipe(gulp.dest(basePath+"\\levis\\css"));
}

gulp.task("watchall",async ()=>{

    gulp.watch("*.html", async ()=>{
        copyhtml();
     });
     
    gulp.watch("php/**/*", async ()=>{
        copyPhp();
     });

    
    gulp.watch("images/**/*", async ()=>{
      copyImages();
    });

    
    gulp.watch("js/**/*", async ()=>{
        copyjs();
    });
   
    gulp.watch("sass/*.scss", async ()=>{
        doSass()
    });
});

gulp.task("all",async ()=>{
    copyPhp();
    copyhtml();
    copyImages();
    copyjs();
    doSass();
    copyCss()
});
